<!DOCTYPE html>
<html data-dpr="1" style="font-size: 39px;">

<head>
    {include file="common/meta2" /}
    {include file="common/meta3" /}
</head>

<body class="jui_bg_grey" style="font-size: 12px;">
    <!-- 头部 -->
    <div class="jui_top_bar">
        <a class="jui_top_left" href="javascript:history.back(-1)"><img
                src="/assets/img2/back_111.png"></a>
        <div class="jui_top_middle">修改密码</div>
    </div>
    <!-- 头部end -->
    <!-- 主体 -->
    <form action="">
        <div class="jui_bg_fff">
            <div class="jui_public_list jui_flex_justify_between">
                <p class="mima_left">原密码</p>
                <input class="jui_flex1" type="text" placeholder="原密码" id="o_pass">
            </div>
            <div class="jui_public_list jui_flex_justify_between">
                <p class="mima_left">新密码</p>
                <input class="jui_flex1" type="password" placeholder="新密码" id="n_pass1">
            </div>
            <div class="jui_public_list jui_flex_justify_between">
                <p class="mima_left">确认新密码</p>
                <input class="jui_flex1" type="password" placeholder="确认新密码" id="n_pass2">
            </div>
        </div>
        <div class="jui_public_btn"><input type="button" value="保存"></div>
    </form>
    <script language="javascript">
        $(function () {
            $('.jui_public_btn').click(function () {
                var o_pass = $('#o_pass').val();
                var n_pass1 = $('#n_pass1').val();
                var n_pass2 = $('#n_pass2').val();
                if (o_pass == '' || o_pass.length < 6) {
                    layer.msg('请输入原密码,最低六位'); return;
                }
                if (n_pass1 == '' || n_pass1.length < 6) {
                    layer.msg('请输入新密码,最低六位'); return;
                }
                if (n_pass2 == '' || n_pass2.length < 6) {
                    layer.msg('请确认新密码,最低六位'); return;
                }
                if (n_pass1 != n_pass2) {
                    layer.msg('两次密码输入不一致'); return;
                }
                $.post("/index/user/repass", { o_pass: o_pass, n_pass: n_pass1 }, function (ret) {
                    if (ret.code == 1) {
                        layer.msg(ret.msg, { icon: 1, time: 1000 }, function () {
                            window.location.href = '/index/user/index';
                        });
                    } else {
                        layer.msg(ret.msg);
                    }
                }, 'json');
            });
        });
    </script>



</body>

</html>